// $Id: distributions.h 58 2004-10-20 11:05:39Z hansemil $
#ifndef DISTRIBUTIONS_H
#define DISTRIBUTIONS_H

#include "chosenton.h"

/**
 * Base class for the Distributions classes. This class has no particular use except from being called to get the instance of the current Distributons-object.
 * Call getInstance() on this class to get the current Distributions object.
 * Overload this class to create a new distributions implementation.
 * @warning This class and it's subclasses are quite special in use. You MUST to instanciate one of the subclasses to this class before calling getInstance()! Normaly only one subclass instance should be used at one time.
 * @todo Describe the purpuse of distributions.
 */
class Distributions : public Chosenton<Distributions> {
public:
	virtual ~Distributions() {}

	// The different distributions (all virtual)
	/// Shall take a value between 0 and RAND_MAX and return the downstream bandwidth in bytes per timestep.
	virtual unsigned int bandwidthDown(unsigned int) = 0;
	/// Shall take a value between 0 and RAND_MAX and return the upstream bandwidth in bytes per timestep.
	virtual unsigned int bandwidthUp(unsigned int) = 0;
	/// Shall take a value between 0 and RAND_MAX and return the file popularity in a value between 0 and RAND_MAX
	virtual unsigned int filePopularity(unsigned int) = 0;
	/// Shall take a value between 0 and RAND_MAX and return the file size in bytes
	virtual unsigned int fileSize(unsigned int) = 0;

protected:
	Distributions(bool leaveInstance=false) : Chosenton<Distributions>(leaveInstance) {}
	friend class Chosenton<Distributions>;
};

#endif
